Printer and method for controlling the same

ABSTRACT

A printer which includes a paper selector for setting return amount and return amount memories for storing return amounts for at least two kinds of recording paper. The type of recording paper is selected by a printer control command so that a return amount for continuing a printing operation specific to the selected type of recording paper can be set. As a result, printing can be executed once a return amount has been set for each type of recording paper if the user wishes to print on different types of recording paper having different return amounts, thereby reducing the burden on the part of the host computer in controlling the printer and increasing the printing speed of the printer.

This is a Continuation-in-Part of application No. 07/791,286 filed Nov.13, 1991 which is now U.S. Pat. No. 5,214,750.

BACKGROUND OF THE INVENTION

The present invention relates to printers which are connected to a hostcomputer through a transmission line such that a printing operation isperformed based upon control commands received from the host computer.More particularly, the present invention is directed to a POS printercapable of transferring at least two types of recording paper.

Conventional printers capable of printing on at least two types ofrecording paper include only one memory for storing a valuecorresponding to the amount of return required to transfer the recordingpaper for printing on successive lines of the recording paper. Once areturn amount has been set, such return amount is applied to all typesof recording paper supplied to the printers.

Therefore, conventional printers involve the operation of setting areturn amount every time the type of recording paper is changed when thereturn amount is different from one type of recording paper to another.Therefore, the burden on the part of the host computer which isresponsible for controlling the printer is increased, and the printingspeed of the printer is decreased since the host computer must transmita control command for setting a return amount for each type of recordingpaper supplied to the printer.

SUMMARY OF THE INVENTION

The present invention has been designed to overcome the above problems.Accordingly, an object of the present invention is to provide a printercapable of setting a return amount corresponding to the type ofrecording paper for at least two types of recording paper and to providefor the selection of the type of recording paper for which to set areturn amount, as well as a method for controlling the printer.

A printer according to the present invention includes a recording papertransfer mechanism for independently transferring at least two types ofrecording paper and a printing mechanism for printing on at least thetwo types of recording paper and provides for the setting of a returnamount specific to the type of recording paper selected.

A method for controlling the printer involves the steps of selecting thetype of recording paper for which to set a return amount and storing thereturn amount in a return amount memory. The printing operation for aselected recording paper includes the steps of transferring the selectedrecording paper to the printing position by the recording paper transfermechanism, driving the print head to perform the printing operation,executing a return operation based upon the return amount correspondingto the selected recording paper, and repeating the above-mentioned stepsuntil the printing operation is complete.

According to the above construction, the return amount can be set foreach type of recording paper and the type of recording paper for whichto set a return amount can be selected, thereby reducing the burden onthe part of the host computer that controls the printer. In addition,the printing speed of the printer is increased since the host computerdoes not have to transmit a control command for setting a return amountfor each printing operation performed with a different type of recordingpaper.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a functional diagram illustrating the construction of theprinter according to the present invention;

FIG. 2 is a control block diagram illustrating the general configurationof the printer according to the present invention;

FIG. 3 is a schematic diagram illustrating the construction of aprinting mechanism and a recording paper transferring mechanismaccording to the present invention, as well as an operation of therespective mechanical parts thereof in accordance with the type ofrecording paper;

FIG. 4 is a flowchart illustrating the operation performed by theprinter according to the present invention when a control command forcontrolling the return amount setting paper selecting means is received;

FIG. 5 is a flowchart illustrating the operation performed by theprinter according to the present invention when a control command forsetting a return amount is received;

FIG. 6 is a flowchart illustrating the operation performed by theprinter according to the present invention when a sheet of slip paper isprinted and returned;

FIG. 7 is a flowchart illustrating the operation performed by theprinter according to the present invention when a sheet of continuouspaper is printed and returned; and

FIG. 8 is a diagram illustrative of an embodiment of a control commandused in the present invention.

DESCRIPTION OF THE PREFERRED EMBODIMENT

A printer constructed according to a preferred embodiment of theinvention will now be described.

FIG. 3 is a schematic diagram illustrating the construction of aprinting mechanism and a recording paper transfer mechanism of theprinter according to the present invention, which is capable of printingon at least two types of recording paper, i.e., continuous paper andslip paper, and is able to transfer each type of paper independently.FIG. 3 also illustrates the operation of the respective mechanical partsdepending upon the type of paper selected.

Reference numeral 1 designates a print head which includes printing wirepins 1a and an ink ribbon 1b. Printing is carried out on a sheet ofcontinuous paper 13 or a sheet of slip paper 14 that is held between theprinting wire pins 1a and a platen 2.

Reference numeral 3 designates a drive roller for transferring the slippaper 14. A slip paper hold roller 4 is arranged on an arm 11 andlocated at a position confronting the drive roller 3 and is moved by thearm 11. The platen 2 is similarly fixed on the arm 11. The arm 11 isrotatable in both directions illustrated by arrows A and B around asupporting point 11a by a plunger 12. A printing part opening/closingmechanism is composed mainly of the platen 2, the arm 11, and theplunger 12. Further, a transfer part opening/closing mechanism iscomposed mainly of the slip paper hold roller 4, the arm 11, and theplunger 12. A slip paper transfer mechanism 10 is composed mainly of thesame components as the transfer part opening/closing mechanism and thedrive roller 3. The printing part opening/closing mechanism is designedto change the distance between the print head 1 of the printingmechanism and the platen 2. The printing part opening/closing mechanismand the transfer part opening/closing mechanism share in common a drivesource and the arm 11, which serves as a transmission member.

Reference numeral 5 designates a drive roller which confronts a slippaper hold roller 6. The slip paper hold roller 6 is arranged on an arm16 which is rotatable in the directions indicated by arrows C and Daround a supporting point 16a by a plunger 17. A slip paper transfermechanism 15 is composed mainly of the drive roller 5, the slip paperhold roller 6, the arm 16, and the plunger 17. Reference numeral 23designates a slip paper guide forming a slip paper transfer passage 22.

A slip paper detector 24 illustrated as an optical sensor of an opposedarrangement type having an optical axis 24a, detects the presence orabsence of the slip paper 14 depending upon whether or not the opticalaxis 24a is shut off.

A step motor is generally used as a drive source for transferring theslip paper 14. The slip paper transfer mechanisms 10, 15 are connectedto the same drive source. When rotation of the motor (not shown) istransmitted to the drive rollers 3, 5 by a power transmission mechanism(not shown) constituted by a transmission system such as gears, a sheetof slip paper 14 is held between the drive rollers 3, 5 and the slippaper hold rollers 4, 6 confronting such drive rollers. The slip paper14 is printed and transferred through a section indicated by arrows 14Ato 14B as a slip paper passage.

A sheet of continuous paper 13 is transported forward via the driveroller 7 passing through the interior of the arm 11 supporting theplaten 2 from a continuous paper supply part (not shown) locatedoutside. This arrangement serves as a continuous paper passage.Thereafter, the paper passes over a paper guide 21. Reference numeral 8designates a continuous paper hold roller confronting the drive roller7. A continuous paper transfer mechanism 20 is composed mainly of thedriver roller 7 and the continuous paper hold roller 8. A drive sourceof the drive roller 7 is connected to the same source as the slip papertransfer mechanisms 10, 15. The drive roller 7 is designed to becontrolled by the power transmission mechanism (not shown).

FIG. 2 is a control block diagram illustrating the general configurationof the present invention. Reference numeral 100 designates a printermechanism previously described with reference to FIG. 3. The printermechanism includes a print head 101, a printing part opening/closingmechanism that also serves as a transfer opening/closing mechanism 102,a transfer opening/closing mechanism 103, a motor 104 serving as a powersource for transferring the continuous paper 13 and the slip paper 14, apower transmission mechanism 105 for transmitting the power of the motor104 to the drive rollers 3, 5, 7, and a slip paper detector 106. Theprinter mechanism also includes a CPU 60, a ROM 61 for storing programsfor controlling the printer, and a RAM 62 used for temporary storage andfor storing return amounts for both the continuous paper 13 and the slippaper 14. The printer mechanism further includes an interface 63, a headcontrol circuit 71, a first plunger control circuit 72, a second plungercontrol circuit 73, a motor control circuit 74, a clutch control circuit75, and a detector circuit 76 connected to a slip paper detector 106 fordetecting the presence or absence of a sheet of slip paper 14.

Upon input of printing data from the interface 63, the printing data istemporarily stored in the RAM 62. The CPU analyzes the data, reads thecharacter font data corresponding to the data code, and executes aprinting operation by controlling the printer mechanism through themotor control circuit 74, the head control circuit 71, and one of thefirst and second plunger control circuits 72, 73.

FIG. 1 is a functional diagram illustrating the present invention.

A control command supplied to the interface 63 from a host computer 80via a transmission line 81 is analyzed by a control command analyzer 82,and the execution of the analyzed control command is initiated by acontrol command executing controller 83. The control command executingcontroller 83 controls, in accordance with the control command, a paperselector 84 for setting return amount which represents the amount oflines which are fed by the feeding motor when the return operation isexecuted. In addition, the control command executing controller 83controls a return amount memory 85 for continuous paper for storing areturn amount to be set for the continuous paper 90 when the continuouspaper is selected by the paper selector 84, and a return amount memory86 for slip paper for storing a return amount to be set for the slippaper 91 when the slip paper is selected by the paper selector 84.

A continuous paper transfer device 87 is provided for transferring thecontinuous paper 90 by controlling the continuous paper transfermechanism 20 based upon the return amount set at the return amountmemory 85 for the continuous paper. A slip paper transfer device 88 isprovided for transferring the slip paper 91 by controlling the slippaper transfer mechanisms 10, 15 based upon the return amount set at thereturn amount memory 86 for slip paper. The continuous paper transferdevice 87, the slip paper transfer device 88, and a print controller 89including the print head 1 and the platen 2 for printing on thecontinuous paper 90 and the slip paper 91 are each controlled by thecontrol command executing controller 83.

Practical operation is described as follows with reference to FIGS. 1and 2. CPU 60 performs as control command analyzer 82, control commandexecuting controller 83 and paper selector for setting return amount 84in cooperation with ROM 61 and RAM 62. Return amount memories (85, 86)are realized by CPU 60 and RAM 62. Continuous paper transfer device 87is realized by plunger control device 72, transfer opening/closingmechanism 102, motor control circuit 74 and motor 104. Slip papertransfer device 88 is realized by plunger control circuit 74, 73,transfer opening/closing mechanisms 102,103, motor control circuit 74and motor 104. Print controller 89 is realized by head control circuit71 and print head 101.

FIG. 4 is a flowchart providing an illustrative example of the operationperformed when the printer has received a control command forcontrolling the paper selector 84.

Upon reception of a control command by the interface 63 (Step 110), thecontrol command analyzer 82 analyzes the received control command (Step111). If the analyzed control command includes information forcontrolling the paper selector 84 (Step 112), and if the control commanddesignates the continuous paper as the type of return amount settingpaper (Step 113), then the continuous paper is selected as the returnamount setting paper (Step 114). If the control command designates theslip paper as the type of return amount setting paper (Step 115), thenthe slip paper is selected as the return amount setting paper (Step116).

If the control command analyzed by the control command analyzer 82 doesnot include information for controlling the paper selector 84 (Step112), another control command is executed (Step 117).

FIG. 5 is a flowchart providing an illustrative example of the operationperformed when the printer has received a control command for setting areturn amount.

Upon reception of a control command by the interface 63 (Step 120), thecontrol command is analyzed by the control command analyzer 82 (Step121). When the control command includes information for setting a returnamount (Step 122), and if the continuous paper is selected as the typeof paper for which to set a return amount by the paper selector 84 (Step123), then a return amount set for the continuous paper is stored in thereturn amount memory 85 for the continuous paper (Step 124). If the slippaper is selected as the type of paper for which to set a return amountby the paper selector 84 (Step 125), then a return amount set for theslip paper is stored in the return amount memory 86 for the slip paper(Step 126).

If the control command analyzed by the control command analyzer 82 doesnot include information for setting a return amount (Step 122), thenanother control command is executed (Step 127).

FIG. 6 is a flowchart providing an illustrative example of the operationperformed when the printer prints on the slip paper.

When the slip paper is selected as the recording paper by executing acontrol command and operating switches of the printer, etc., theplungers 12, 17 are deenergized, causing the slip paper transfermechanisms 10, 15 and the printing part opening/closing mechanism to beopened to prepare the printer to receive a sheet of slip paper 14 (Step130). The sheet of slip paper 14 is then positioned at a form stopper(not shown) (Step 131). When the slip paper 14 has been set in place,the optical axis 24a of the slip paper detector 24 is shut off so thatthe presence of the slip paper is detected (Step 132). Such detectionthen causes the plunger 17 to be energized, the slip paper transfermechanism 15 to be closed, and the slip paper 14 to be held between thedrive roller 5 and the slip paper hold roller 6 (Step 133). Then, themotor (not shown) is driven so that the slip paper 14 is transferred,along the paper guide 23, to a position past a front end of the printingpart that is in an open state, thereby completing the positioning (Step134) of the slip paper 14.

When the plunger 12 has been energized thereafter, the printing partopening/closing mechanism is closed, causing the platen 2 to be set to aprintable position and preparing the printer for a printing operation(Step 135). The slip paper transfer mechanism 10 is closedsimultaneously with the printing part opening/closing mechanism. Then,based upon the control command, printing is executed by driving theprint head 1 (Step 136). Further, based upon the return amount of theslip paper set in the return amount memory 86 for the slip paper (Step137), the driving force of the motor (not shown) is transmitted only tothe drive rollers 3, 5 but not to the drive roller 7 by the powertransmission mechanism (not shown), so that only the slip paper 14 istransferred in the direction of the arrow 14A and the printer executes areturn operation (Step 138).

The printing and returning operation is repeated (Step 139), and whensuch repetition has been completed, the slip paper 14 is discharged inthe direction of the arrow 14B while transmitting the drive force of themotor (not shown) only to the drive rollers 3, 5 but not to the driveroller 7 by the power transmission mechanism (not shown) (Step 140). Theplungers 12, 17 are then deenergized, so that the slip paper transfermechanism is opened (Step 141) to thereby complete a series of printingoperations on the slip paper 14.

FIG. 7 is a flowchart illustrating the operation performed when theprinter prints on the continuous paper 13.

When the plunger 12 is energized with the continuous paper 13 being heldon the drive roller 7 and set while passing between the platen 2 and theprint head 1, the printing part opening/closing mechanism is closed toprepare the printer for printing, with the platen 2 being set to aprintable position (Step 150). Then, based on a control command,printing is started by the operation of the print head 1 (Step 151) andbased on the return amount set for the continuous paper in the returnamount memory 85 for the continuous paper (Step 152), the drive force ofthe motor (not shown) is transmitted to the drive roller 7 by the powertransmission mechanism to transfer the continuous paper 13 and execute areturn operation (Step 153).

The printing and returning operation is repeated (Step 154), and whensuch repetition has been completed, the plunger 12 is deenergized andthe printing part opening/closing mechanism is opened (Step 155).

FIG. 8 is a diagram illustrative of an example of the control command tobe used in the present invention. The control command designates thepaper for which to set a return amount. A code, "ESC c1" 201, indicatesthe type of control command. When this code is read by the controlcommand analyzer, the control command analyzer interprets that thecontrol command is directed to selecting the type of paper for which toset a return amount. A code, "n" 202, indicates a code of the type ofrecording paper for which to set a return amount. The code is expressedin, e.g., hexadecimal, with 1H indicating the continuous paper, 10H, theslip paper, and 11H, both the continuous paper and the slip paper. Whensuch a code is set, the type of recording paper corresponding to the setcode is selected.

The default value is, e.g., 11H, allowing both the continuous paper andthe slip paper to be selected as the paper for which return amounts areset.

Specifically, "ESC" represent corresponding ASCII code, i.e. "1BH" where"H" is a hexadecimal indicator. "c1", which is a pair of characters,also represents corresponding ASCII codes, i.e. "63H" and "31H".Therefore, if the parameter code "n" is "01H", the return amount for thecontinuous paper is to be set, the whole code being "1BH 63H 31H 01H".

As described above, the return amount setting procedure is completed byexecuting a pair of commands, namely a command for selecting the mediatype and a command for setting the return amount. "ESC c1 (n)" is anexample of the former command. As example of latter command, "ESC 3 (n)"is provided. This command is used for setting the line spacing to n/240of an inch. If the return amount should be set to 1/6 inch, "n" shouldbe 40 (28 in hexadecimal). In this case, the command code is decided as"1BH 33H 28H". Therefore, if the return amount for the continuous papershould be set to 1/6, then the whole code which should be sent to theprinter should be "1BH 63H 31H 01H 1BH 33H 28H".

As set forth in the foregoing description, the printer according to thepresent invention provides for the selection of the type of recordingpaper by a printer control command so that a return amount can be set bythe type of recording paper selected. As a result, printing can beexecuted once a return amount has been set for each type of recordingpaper if the user wishes to print on different types of recording paperhaving different return amounts, respectively, thereby reducing theburden on the part of the host computer in controlling the printer. Inaddition, the printing speed of the printer is increased, since the hostcomputer does not have to transmit a control command for setting areturn amount for each printing operation performed with a differenttype of recording paper.

What is claimed is:
 1. A printer capable of printing on at least twotypes of recording paper, said printer comprising:printing means forprinting on said at least two types of recording paper with a singleprint head; recording paper transfer means for independentlytransferring said at least two types of recording paper to said printingmeans; a plurality of return amount memory means for respectivelystoring return amount values corresponding to said at least two types ofrecording paper, wherein said return amount values represent an amountby which said recording paper must be transferred between printingoperations on successive lines; an interface for receiving a controlcommand code for controlling a printing operation from a host computer;control command analyzing means for interpreting said control commandcode received from said host computer; recording paper selecting meansfor selecting one of said at least two types of recording paper basedupon said control command code; and control means for controlling saidplurality of return amount memory means for storing said return amountvalues and for retrieving a return amount value from one of saidplurality of return amount memory means corresponding to a selected oneof said at least two types of recording paper.
 2. A method forcontrolling a printing operation of a printer which includes printingmeans for printing on at least two types of recording paper with asingle print head, recording paper transfer means for independentlytransferring said at least two types of recording paper to said printingmeans, a plurality of return amount memory means for respectivelystoring return amount values corresponding to said at least two types ofrecording paper, an interface for receiving a control command code forcontrolling a printing operation from a host computer, control commandanalyzing means for interpreting said control command code received fromsaid host computer, recording paper selecting means for selecting one ofsaid at least two types of recording paper based upon said controlcommand code, and control means for controlling said plurality of returnamount memory means and for retrieving a return amount value from one ofsaid plurality of return amount memory means corresponding to a selectedone of said at least two types of recording paper, said methodcomprising the steps of:receiving a control command code from said hostcomputer; interpreting said control command code received from said hostcomputer; selecting one of said at least two types of recording paper tobe supplied to said printing means for said printing operation basedupon said control command code; and storing a return amount value basedupon a selected recording paper for controlling a return operation ofsaid printing means between printing on successive lines of saidselected recording paper.
 3. The method according to claim 2, whereinsaid printing operation for said selected recording paper comprises thesteps of:transferring said selected recording paper to a printingposition by said recording paper transfer means; driving said print headto perform said printing operation; executing said return operationbased upon said return amount value corresponding to said selectedrecording paper; and repeating said transferring of said selected paper,said driving of said print head and said return operation until saidprinting operation is completed.
 4. A printer capable of printing on atleast two types of recording paper, said printer comprising:a printhead; a recording paper transfer mechanism configured to transport,independently, at least the two types of recording paper to a positionfacing said print head; a plurality of return amount memories forstoring respective return amount values corresponding to the at leasttwo types of recording paper, wherein the return amount values representa paper feed amount between successive lines of print; and a processorcontrolling said recording paper transfer mechanism and said returnamount memories in accordance with control command codes received from ahost computer, such that the received control command codes (a) controlsaid return amount memories to output a return amount valuecorresponding to a selected one of the at least two types of recordingpaper and (b) control said recording paper transfer mechanism totransport the selected type of recording paper by a return amountcorresponding to the return amount value output by said return amountmemories.
 5. A printer capable of printing on at least two types ofrecording paper, said printer comprising:printing means for printing onsaid at least two types of recording paper with a single print head;recording paper transfer means for independently transferring said atleast two types of recording paper to said printing means; a pluralityof return amount memory means for respectively storing return amountvalues corresponding to said at least two types of recording paper,wherein said return amount values represent an amount by which saidrecording paper must be transferred between printing operations onsuccessive lines; an interface for receiving a control command code forcontrolling a printing operation from a host computer; control commandanalyzing means for interpreting said control command code received fromsaid host computer; first recording paper selecting means for selectingone of said at least two types of recording paper for which the returnamount value is to be set based upon said control command code; secondrecording paper selecting means for selecting at least one of said atleast two types of recording paper to be transferred by said recordingpaper transfer means based upon said control command code; and controlmeans for controlling said plurality of return amount memory means forstoring said return amount values corresponding to the recording paperselected by said first recording paper selecting means and forretrieving at least one of said return amount values corresponding tothe recording paper selected by said second recording paper selectingmeans.
 6. A method for controlling a printing operation of a printerwhich includes printing means for printing on at least two types ofrecording paper with a single print head, recording paper transfer meansfor independently transferring said at least two types of recordingpaper to said printing means, a plurality of return amount memory meansfor respectively storing return amount values corresponding to said atleast two types of recording paper, an interface for receiving a controlcommand code for controlling a printing operation from a host computer,control command analyzing means for interpreting said control commandcode received from said host computer, first recording paper selectingmeans for selecting one of said at least two types of recording paperfor which the return amount value is to be set based upon said controlcommand code, second recording paper selecting means for selecting atleast one of said at least two types of recording paper to betransferred by said recording paper transfer means based upon saidcontrol command code, and control means for controlling said pluralityof return amount memory means for storing said return amount valuescorresponding to the recording paper selected by said first recordingpaper selecting means and for retrieving at least one of said returnamount values corresponding to the recording paper selected by saidsecond recording paper selecting means, said method comprising the stepsof:receiving a control command code from said host computer;interpreting said control command code received from said host computer;selecting one of said at least two types of recording paper to besupplied to said printing means for said printing operation based uponsaid control command code; and storing a return amount value based upona selected recording paper for controlling a return operation of saidprinting means between printing on successive lines of said selectedrecording paper.